package top.wardyan.wmes.rfid.pub;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.jfinal.core.ActionKey;
import com.jfinal.core.Path;

import top.wardyan.common.ctrl.BaseController;
import top.wardyan.wmes.rfid.kqa.dto.DeviceStateUpdateDto;
import top.wardyan.wmes.rfid.kqa.dto.DrvCmdTempDto;
import top.wardyan.wmes.rfid.kqa.vo.BaseRequest;
import top.wardyan.wmes.rfid.kqa.vo.BaseResponse;

/**
 * @author lcf
 * @CreateTime 2022/1/19 13:33
 * @Description 设备状态
 */

@Path("/ds")
@SuppressWarnings("unchecked")
public class DeviceStateController extends BaseController {

	private static final cn.hutool.log.Log log = cn.hutool.log.Log.get();
	
	@ActionKey("/update-state")
    public void updateDeviceState(){
//        // log.info("修改设备状态，请求参数为：" + JSONObject.toJSON(request).toString());
//        BaseResponse<String> response = new BaseResponse<>();
////        DeviceStateUpdateDto dto = request.getData();
////        String msg = deviceStateService.updateDeviceState(dto);
////        if(!msg.equals("")){
////            response.setResult(500, msg);
////            return response;
////        }
////        response.setCode(200);
//        this.renderJson(response);
		BaseRequest<DeviceStateUpdateDto> params = this.getJson(BaseRequest.class);
  		if(log.isInfoEnabled()) {
  			log.info("修改设备状态,请求参数为:" + JSONObject.toJSONString(params));
  		}
  		BaseResponse<List<DrvCmdTempDto>> response = new BaseResponse<>();
  		response.setSuccess("OK");
  		// response.setData("ok");
  		this.renderJson(response);
    }

}
